#include<iostream>

#include<unistd.h>

using namespace std;

int tmp = 100;

int main()
{
  pid_t id = fork();
  if(id == 0){
    int s = 5;
    while(1){
      cout<<"pid : "<<getpid()<<" ppid : "<<getppid()<<" tmp : "<<tmp<<" &tmp : "<<&tmp << endl;
      sleep(1);
      s--;
      if(!s) tmp = 200;
    }
  }
  else{
    while(1){
      cout<<"pid : "<<getpid()<<" ppid : "<<getppid()<<" tmp : "<<tmp<<" &tmp : "<<&tmp << endl;
    sleep(1);
    }
  }
  return 0;
}
